package com.cs.study.homework._0207;

import java.util.Scanner;

public class Line {
    public static void main(String[] args) {
        System.out.println("请输入直线条数：");
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int part = cut(n);
        System.out.println(n + "条线最多可以把平面分成" + part + "份");

    }
    public static int cut(int n) {
        int part = 0;
        if (n == 1) {
            part = 2;
        } else if (n >= 2) {
            part = cut(n - 1) + n;
        }
        return part;
    }
}
